public class MethodDetail{
	public static void main(String[] args) {
		AA a = new AA();
		int[] resa = a.getSumAndSub(3,1);
		System.out.println(resa[0]+" "+ resa[1]);
		}
}

class AA{
	public int[] getSumAndSub(int n1,int n2){
		int[] res = new int[2];
		res[0] = n1+n2;
		res[1] = n1-n2;
		return res;
	}
}